package com.Archive.firstWeek;

import javax.sound.midi.Soundbank;
import java.util.Scanner;

public class Multithreading {
    public static String str = "hello";

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);

        new Thread() {
            public void run() {
                while (true) {
                    System.out.println(str);
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        }.start();

        while (true) {
            str = input.nextLine();
        }
    }
}